import React, {Component} from 'react';


class Child extends Component {
    render() {
        return (
            <div>
                child
                {this.props.children[0]}
            </div>
        );
    }
}

class Swipe extends Component{
    render() {
        return(
            <div>
                {this.props.children}
            </div>
        )
    }
}

class App extends Component {
    render() {
        return (
            <div>
                <Swipe>
                    <div>111</div>
                    <div>222</div>
                    <div>333</div>
                </Swipe>

                <Swipe>
                    <div>444</div>
                    <div>555</div>
                    <div>666</div>
                </Swipe>

                <Child>
                    <div>111111</div>
                    <div>222222</div>
                    <div>333333</div>
                </Child>
            </div>
        );
    }
}
//为了复用,一定程度上减少父子通信

export default App;
